package com.authine.cloudpivot.ext.enums;

/**
 * 购物车类型
 */
public enum CartTypeEnum {

    ALL(0, "全部"),
    DIRECT(1, "直采"),
    INQUIRE(2, "询采"),
    SHOP(3, "商城"),
    EnterpriseMall(4,"客户企业商城");

    public Integer id;
    public String text;

    CartTypeEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public Integer getId() {
        return id;
    }

    public String getText() {
        return text;
    }

    public static CartTypeEnum get(Integer code) {

        for (CartTypeEnum c : CartTypeEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}
